package com.ezhuan.system.pojo;

import java.util.Date;

import com.ezhuan.common.pojo.BasePojo;

public class ACate extends BasePojo<ACate>
{
	private String name;
	private String content;
	private byte cateType;
	private byte status;
	private Date createTime;
	private Date updateTime;
	private Date pubTime;

	/* 字符串描述 */
	private String cateTypeStr;
	private String statusStr;

	public String getName()
	{
		return name;
	}

	public void setName(String name)
	{
		this.name = name;
	}

	public String getContent()
	{
		return content;
	}

	public void setContent(String content)
	{
		this.content = content;
	}

	public Date getCreateTime()
	{
		return createTime;
	}

	public void setCreateTime(Date createTime)
	{
		this.createTime = createTime;
	}

	public Date getUpdateTime()
	{
		return updateTime;
	}

	public void setUpdateTime(Date updateTime)
	{
		this.updateTime = updateTime;
	}

	public Date getPubTime()
	{
		return pubTime;
	}

	public void setPubTime(Date pubTime)
	{
		this.pubTime = pubTime;
	}

	@Override
	public String getTableName()
	{
		return "a_cate";
	}

	public byte getCateType()
	{
		return cateType;
	}

	public void setCateType(byte cateType)
	{
		this.cateType = cateType;
	}

	public byte getStatus()
	{
		return status;
	}

	public void setStatus(byte status)
	{
		this.status = status;
	}

	public String getCateTypeStr()
	{
		// 根据状态值获取字符串描述
		ACateEnum[] cateEnums = ACateEnum.values();
		for (int i = 0; i < cateEnums.length; i++)
		{
			ACateEnum cateEnum = cateEnums[i];
			if (cateEnum.toString().startsWith("CATETYPE_"))
			{
				// 表示是状态的标识
				if (cateEnum.getStatus() == this.getCateType())
				{
					this.cateTypeStr = cateEnum.getName();
					break;
				}
			}
		}
		return this.cateTypeStr;
	}

	public String getStatusStr()
	{
		// 根据状态值获取字符串描述
		ACateEnum[] cateEnums = ACateEnum.values();
		for (int i = 0; i < cateEnums.length; i++)
		{
			ACateEnum cateEnum = cateEnums[i];
			if (cateEnum.toString().startsWith("STATUS_"))
			{
				// 表示是状态的标识
				if (cateEnum.getStatus() == this.getStatus())
				{
					this.statusStr = cateEnum.getName();
					break;
				}
			}
		}
		return statusStr;
	}

}
